package org.neuedu.chapter10_0702.demo07;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        Student s1 = new Student(22, "tom");
        Student s2 = new Student(23, "lucy");
        Student s3 = new Student(24, "mike");
        Student s4 = new Student(25, "ella");
        Student s5 = new Student(26, "allen");

        List<Student> list = new ArrayList<>();
        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);
        list.add(s5);

        Student s6 = new Student(26, "allen");
        System.out.println(s6.equals(s5));// false

        int i = list.indexOf(s6);
        System.out.println(i);
    }
}
